System with wide operand architecture, and method

ABSTRACT

The present invention provides a system and method for improving the performance of general purpose processors by expanding at least one source operand to a width greater than the width of either the general purpose register or the data path width. In addition, the present invention provides several classes of instructions which cannot be performed efficiently if the operands are limited to the width and accessible number of general purpose registers The present invention provides operands which are substantially larger than the data path width of the processor by using a general purpose register to specify a memory address from which at least moire than one, but typically several data path widths of data can be read. The present invention also provides for the efficient usage of a multiplier array that is fully used for high precision arithmetic, but is only partly used for other, lower precision operations.

FIELD OF THE INVENTION

[0001] The present invention relates to general purpose processorarchitectures, and particularly relates to wide operand architectures.

BACKGROUND OF THE INVENTION

[0002] The performance level of a processor, and particularly a generalpurpose processor, can be estimated from the multiple of a plurality ofinterdependent factors: clock rate, gates per clock, number of operands,operand and data path width, and operand and data path partitioning.Clock rate is largely influenced by the choice of circuit and logictechnology, but is also influenced the number of gates per clock. Gatesper clock is how many gates in a pipeline may change state in a singleclock cycle. This can be reduced by inserting latches into the datapath: when the number of gates between latches is reduced, a higherclock is possible. However, the additional latches produce a longerpipeline length, and thus come at a cost of increased instructionlatency. The number of operands is straightforward; for example, byadding with carry-save techniques, three values may be added togetherwith little more delay than is required for adding two values. Operandand data path width defines how much data can be processed at once;wider data paths can perform more complex functions, but generally thiscomes at a higher implementation cost. Operand and data pathpartitioning refers to the efficient use of the data path as width isincreased, with the objective of maintaining substantially peak usage.

[0003] The last factor, operand and data path partitioning, is treatedextensively in commonly-assigned U.S. Pat. Nos. 5,742,840, 5,794,060,5,794,061, 5,809,321, and 5,822,603, which describe systems and methodsfor enhancing the utilization of a general purpose processor by addingclasses of instructions. These classes of instructions use the contentsof general purpose registers as data path sources, partition theoperands into symbols of a specified size, perform operations inparallel, catenate the results and place the catenated results into ageneral-purpose register. These patents, all of which are assigned tothe same assignee as the present invention, teach a general purposemicroprocessor which has been optimized for processing and transmittingmedia data streams through significant parallelism.

[0004] While the foregoing patents offered significant improvements inutilization and performance of a general purpose microprocessor,particularly for handling broadband communications such as media datastreams, other improvements are possible.

[0005] Many general purpose processors have general registers to storeoperands for instructions, with the register width matched to the sizeof the data path. Processor designs generally limit the number ofaccessible registers per instruction because the hardware to accessthese registers is relatively expensive in power and area. While thenumber of accessible registers varies among processor designs, it isoften limited to two, three or four registers per instruction when suchinstructions are designed to operate in a single processor clock cycleor a single pipeline flow. Some processors, such as the Motorola 68000have instructions to save and restore an unlimited number of registers,but require multiple cycles to perform such an instruction.

[0006] The Motorola 68000 also attempts to overcome a narrow data pathcombined with a narrow register file by taking multiple cycles orpipeline flows to perform an instruction, and thus emulating a widerdata path. However, such multiple precision techniques offer onlymarginal improvement in view of the additional clock cycles required.The width and accessible number of the general purpose registers thusfundamentally limits the amount of processing that can be performed by asingle instruction in a register-based machine.

[0007] Existing processors may provide instructions that accept operandsfor which one or more operands are read from a general purposeprocessor's memory system. However, as these memory operands aregenerally specified by register operands, and the memory system datapath is no wider than the processor data path, the width and accessiblenumber of general purpose operands per instruction per cycle or pipelineflow is not enhanced.

[0008] The number of general purpose register operands accessible perinstruction is generally limited by logical complexity and instructionsize. For example, it might be possible to implement certain desirablebut complex functions by specifying a large number of general purposeregisters, but substantial additional logic would have to be added to aconventional design to permit simultaneous reading and bypassing of theregister values. While dedicated registers have been used in some priorart designs to increase the number or size of source operands orresults, explicit instructions load or store values into these dedicatedregisters, and additional instructions are required to save and restorethese registers upon a change of processor context.

[0009] There has therefore been a need for a processor system capable ofefficient handling of operands of greater width than either the memorysystem or any accessible general purpose register.

SUMMARY OF THE INVENTION

[0010] The present invention provides a system and method for improvingthe performance of general purpose processors by expanding at least onesource operand to a width greater than the width of either the generalpurpose register or the data path width. In addition, several classes ofinstructions will be provided which cannot be performed efficiently ifthe operands are limited to the width and accessible number of generalpurpose registers.

[0011] In the present invention, operands are provided which aresubstantially larger than the data path width of the processor. This isachieved, in part, by using a general purpose register to specify amemory address from which at least more than one, but typically severaldata path widths of data can be read. To permit such a wide operand tobe performed in a single cycle, the data path functional unit isaugmented with dedicated storage to which the memory operand is copiedon an initial execution of the instruction. Further execution of theinstruction or other similar instructions that specify the same memoryaddress can read the dedicated storage to obtain the operand value.However, such reads are subject to conditions to verify that the memoryoperand has not been altered by intervening instructions. If the memoryoperand remains current—that is, the conditions are met—the memoryoperand fetch can be combined with one or more register operands in thefunctional unit, producing a result. The size of the result is,typically, constrained to that of a general register so that nodedicated or other special storage is required for the result.

[0012] Exemplary instructions using wide operations include wideinstructions that perform bit-level switching (Wide Switch), byte orlarger table-lookup (Wide Translate), Wide Multiply Matrix, WideMultiply Matrix Extract, Wide Multiply Matrix Extract Immediate, WideMultiply Matrix Floating point, and Wide Multiply Matrix Galois.

[0013] Another aspect of the present invention addresses efficient usageof a multiplier array that is fully used for high precision arithmetic,but is only partly used for other, lower precision operations. This canbe accomplished by extracting the high-order portion of the multiplierproduct or sum of products, adjusted by a dynamic shift amount from ageneral register or an adjustment specified as part of the instruction,and rounded by a control value from a register or instruction portion.The rounding may be any of several types, includinground-to-nearest/even, toward zero, floor, or ceiling. Overflows aretypically handled by limiting the result to the largest and smallestvalues that can be accurately represented in the output result.

[0014] When an extract is controlled by a register, the size of theresult can be specified, allowing rounding and limiting to a smallernumber of bits than can fit in the result. This permits the result to bescaled for use in subsequent operations without concern of overflow orrounding. As a result, performance is enhanced. In those instances wherethe extract is controlled by a register, a single register value definesthe size of the operands, the shift amount and size of the result, andthe rounding control. By placing such control information in a singleregister, the size of the instruction is reduced over the number of bitsthat such an instruction would otherwise require, again improvingperformance and enhancing processor flexibility. Exemplary instructionsare Ensemble Convolve Extract, Ensemble Multiply Extract, EnsembleMultiply Add Extract, and Ensemble Scale Add Extract. With particularregard to the Ensemble Scale Add Extract Instruction, the extractcontrol information is combined in a register with two values used asscalar multipliers to the contents of two vector multiplicands. Thiscombination reduces the number of registers otherwise required, thusreducing the number of bits required for the instruction.

THE FIGURES

[0015]FIG. 1 is a system level diagram showing the functional blocks ofa system according to the present invention.

[0016]FIG. 2 is a matrix representation of a wide matrix multiply inaccordance with the present invention.

[0017]FIG. 3 is a further representation of a wide matrix multiple inaccordance with the present invention.

[0018]FIG. 4 is a system level diagram showing the functional blocks ofa system incorporating a combined Simultaneous Multi Threading andDecoupled Access from Execution processor in accordance with the presentinvention.

[0019]FIG. 5 illustrates a wide operand in accordance with the presentinvention.

[0020]FIG. 6 illustrates an approach to specifier decoding in accordancewith the present invention.

[0021]FIG. 7 illustrates in operational block form a Wide Function Unitin accordance with the present invention.

[0022]FIG. 8 illustrates in flow diagram form the Wide Microcachecontrol function.

[0023]FIG. 9 illustrates Wide Microcache data structures.

[0024]FIGS. 10 and 11 illustrate a Wide Microcache control.

DETAILED DESCRIPTION OF THE INVENTION

[0025] Referring first to FIG. 1, a general purpose processor isillustrated therein in block diagram form. In FIG. 1, four copies of anaccess unit are shown, each with an access instruction fetch queueA-Queue 101-104. Each access instruction fetch queue A-Queue 101-104 iscoupled to an access register file AR 105-108, which are each coupled totwo access functional units A 109-116. In a typical embodiment, eachthread of the processor may have on the order of sixty-four generalpurpose registers (e.g., the AR's 105-108 and ER's 125128). The accessunits function independently for four simultaneous threads of execution,and each compute program control flow by performing arithmetic andbranch instructions and access memory by performing load and storeinstructions. These access units also provide wide operand specifiersfor wide operand instructions. These eight access functional units A109-116 produce results for access register files AR 105-108 and memoryaddresses to a shared memory system 117-120.

[0026] The memory system is comprised of a combined cache and nichememory 117, an external bus interface 118, and, externally to thedevice, a secondary cache 119 and main memory system with I/O devices120. The memory contents fetched from memory system 117-120 are combinedwith execute instructions not performed by the access unit, and enteredinto the four execute instruction queues E-Queue 121-124. For wideinstructions, memory contents fetched from memory system 117-120 arealso provided to wide operand microcaches 132-136 by bus 137.Instructions and memory data from E-queue 121-124 are presented toexecution register files 125-128, which fetch execution register filesource operands. The instructions are coupled to the execution unitarbitration unit Arbitration 131, that selects which instructions fromthe four threads are to be routed to the available execution functionalunits E 141 and 149, X 142 and 148, G 143-144 and 146-147, and T 145.The execution functional units E 141 and 149, the execution functionalunits X 142 and 148, and the execution functional unit T 145 eachcontain a wide operand microcache 132-136, which are each coupled to thememory system 117 by bus 137.

[0027] The execution functional units G 143-144 and 146-147 are grouparithmetic and logical units that perform simple arithmetic and logicalinstructions, including group operations wherein the source and resultoperands represent a group of values of a specified symbol size, whichare partitioned and operated on separately, with results catenatedtogether. In a presently preferred embodiment the data path is 128 bitswide, although the present invention is not intended to be limited toany specific size of data path.

[0028] The execution functional units X 142 and 148 are crossbar switchunits that perform crossbar switch instructions. The crossbar switchunits 142 and 148 perform data handling operations on the data streamprovided over the data path source operand buses 151-158, includingdeals, shuffles, shifts, expands, compresses, swizzles, permutes andreverses, plus the wide operations discussed hereinafter. In a keyelement of a first aspect of the invention, at least one such operationwill be expanded to a width greater than the general register and datapath width. Examples of the data manipulation operations are describedin the Appendix included herewith.

[0029] The execution functional units E 141 and 149 are ensemble unitsthat perform ensemble instructions using a large array multiplier,including group or vector multiply and matrix multiply of operandspartitioned from data path source operand buses 151-158 and treated asinteger, floating-point, polynomial or Galois field values. Matrixmultiply instructions and other operations described in the Appendixincluded herewith utilize a wide operand loaded into the wide operandmicroc-ache 132 and 136.

[0030] The execution functional unit T 145 is a translate unit thatperforms table-look-up operations on a group of operands partitionedfrom a register operand, and catenates the result. The Wide Translateinstruction described in the Appendix included herewith utilizes a wideoperand loaded into the wide operand microcache 134.

[0031] The execution functional units E 141, 149, execution functionalunits X-142, 148, and execution functional unit T each contain dedicatedstorage to permit storage of source operands including wide operands asdiscussed hereinafter. The dedicated storage 132-136, which may bethought of as a wide microcache, typically has a width which is amultiple of the width of the data path operands related to the data pathsource operand buses 151-158. Thus, if the width of the data path151-158 is 128 bits, the dedicated storage 132-136 may have a width of256, 512, 1024 or 2048 bits. Operands which utilize the full width ofthe dedicated storage are referred to herein as wide operands, althoughit is not necessary in all instances that a wide operand use theentirety of the width of the dedicated storage; it is sufficient thatthe wide operand use a portion greater than the width of the memory datapath of the output of the memory system 117-120 and the functional unitdata path of the input of the execution functional units 141-149, thoughnot necessarily greater than the width of the two combined. Because thewidth of the dedicated storage 132-136 is greater than the width of thememory operand bus 137, portions of wide operands are loadedsequentially into the dedicated storage 132-136. However, once loaded,the wide operands may then be used at substantially the same time. Itcan be seen that functional units 141-149 and associated executionregisters 125-128 form a data functional unit, the exact elements ofwhich may vary with implementation.

[0032] The execution register file ER 125-128 source operands arecoupled to the execution units 141-145 using source operand buses151-154 and to the execution units 145-149 using source operand buses155-158. The function unit result operands from execution units 141-145are coupled to the execution register file ER 125-128 using result bus161 and the function units result operands from execution units 145-149are coupled to the execution register file using result bus 162.

[0033] The wide operands of the present invention provide the ability toexecute complex instructions such as the wide multiply matrixinstruction shown in FIG. 2, which can be appreciated in an alternativeform, as well, from FIG. 3. As can be appreciated from FIGS. 2 and 3, awide operand permits, for example, the matrix multiplication of varioussizes and shapes which exceed the data path width. The example of FIG. 2involves a matrix specified by register rc having a 128*64/sizemultiplied by a vector contained in register rb having a 128 size, toyield a result, placed in register rd, of 128 bits.

[0034] The operands that are substantially larger than the data pathwidth of the processor are provided by using a general-purpose registerto specify a memory specifier from which more than one but in someembodiments several data path widths of data can be read into thededicated storage. The memory specifier typically includes the memoryaddress together with the size and shape of the matrix of data beingoperated on. The memory specifier or wide operand specifier can bebetter appreciated from FIG. 5, in which a specifier 500 is seen to bean address, plus a field representative of the size/2 and a furtherfield representative of width/2, where size is the product of the depthand width of the data. The address is aligned to a specified size, forexample sixty-four bytes, so that a plurality of low order bits (forexample, six bits) are zero. The specifier 500 can thus be seen tocomprise a first field 505 for the address, plus two field indicia 510within the low order six bits to indicate size and width.

[0035] The decoding of the specifier 500 may be further appreciated fromFIG. 6 where, for a given specifier 600 made up of an address field 605together with a field 610 comprising plurality of low order bits. By aseries of arithmetic operations shown at steps 615 and 620, the portionof the field 610 representative of width/2 is developed. In a similarseries of steps shown at 625 and 630, the value of t is decoded, whichcan then be used to decode both size and address. The portion of thefield 610 representative of size/2 is decoded as shown at steps 635 and640, while the address is decoded in a similar way at steps 645 and 650.

[0036] The wide function unit may be better appreciated from FIG. 7, inwhich a register number 700 is provided to an operand checker 705. Wideoperand specifier 710 communicates with the operand checker 705 and alsoaddresses memory 715 having a defined memory width. The memory addressincludes a plurality of register operands 720A-n, which are accumulatedin a dedicated storage portion 714 of a data functional unit 725. In theexemplary embodiment shown in FIG. 7, the dedicated storage 714 can beseen to have a width equal to eight data path widths, such that eightwide operand portions 730A-H are sequentially loaded into the dedicatedstorage to form the wide operand. Although eight portions are shown inFIG. 7, the present invention is not limited to eight or any otherspecific multiple of data path widths. Once the wide operand portions730A-H are sequentially loaded, they may be used as a single wideoperand 735 by the functional element 740, which may be any element(s)from FIG. 1 connected thereto. The result of the wide operand is thenprovided to a result register 745, which in a presently preferredembodiment is of the same width as the memory width.

[0037] Once the wide operand is successfully loaded into the dedicatedstorage 714, a second aspect of the present invention may beappreciated. Further execution of this instruction or other similarinstructions that specify the same memory address can read the dedicatedstorage to obtain the operand value under specific conditions thatdetermine whether the memory operand has been altered by interveninginstructions. Assuming that these conditions are met, the memory operandfetch from the dedicated storage is combined with one or more registeroperands in the functional unit, producing a result. In someembodiments, the size of the result is limited to that of a generalregister, so that no similar dedicated storage is required for theresult. However, in some different embodiments, the result may be a wideoperand, to further enhance performance.

[0038] To permit the wide operand value to be addressed by subsequentinstructions specifying the same memory address, various conditions mustbe checked and confirmed: Those conditions include:

[0039] 1. Each memory store instruction checks the memory addressagainst the memory addresses recorded for the dedicated storage. Anymatch causes the storage to be marked invalid, since a memory storeinstruction directed to any of the memory addresses stored in dedicatedstorage 714 means that data has been overwritten.

[0040] 2. The register number used to address the storage is recorded.If no intervening instructions have written to the register, and thesame register is used on the subsequent instruction, the storage isvalid (unless marked invalid by rule #1).

[0041] 3. If the register has been modified or a different registernumber is used, the value of the register is read and compared againstthe address recorded for the dedicated storage.

[0042] This uses more resources than #1 because of the need to fetch theregister contents and because the width of the register is greater thanthat of the register number itself. If the address matches, the storageis valid. The new register number is recorded for the dedicated storage.

[0043] 4. If conditions #2 or #3 are not met, the register contents areused to address the general-purpose processor's memory and load thededicated storage. If dedicated storage is already fully loaded, aportion of the dedicated storage must be discarded (victimized) to makeroom for the new value. The instruction is then performed using thenewly updated dedicated storage. The address and register number isrecorded, for the dedicated storage.

[0044] By checking the above conditions, the need for saving andrestoring the dedicated storage is eliminated. In addition, if thecontext of the processor is changed and the new context does not employWide instructions that reference the same dedicated storage, when theoriginal context is restored, the contents of the dedicated storage areallowed to be used without refreshing the value from memory, usingchecking rule #3. Because the values in the dedicated storage are readfrom memory and not modified directly by performing wide operations, thevalues can be discarded at any time without saving the results intogeneral memory. This property simplifies the implementation of rule #4above.

[0045] An alternate embodiment of the present invention can replace rule#1 above with the following rule:

[0046] 1.a. Each memory store instruction checks the memory addressagainst the memory addresses recorded for the dedicated storage. Anymatch causes the dedicated storage to be updated, as well as the generalmemory.

[0047] By use of the above rule 1.a, memory store instructions canmodify the dedicated storage, updating just the piece of the dedicatedstorage that has been changed, leaving the remainder intact. Bycontinuing to update the general memory, it is still true that thecontents of the dedicated memory can be discarded at any time withoutsaving the results into general memory. Thus rule #4 is not made morecomplicated by this choice. The advantage of this alternate embodimentis that the dedicated storage need not be discarded (invalidated) bymemory store operations.

[0048] Referring next to FIG. 9, an exemplary arrangement of the datastructures of the wide microcache or dedicated storage114 may be betterappreciated. The wide microcache contents, wmc.c, can be seen to form aplurality of data path widths 900A-n, although in the example shown thenumber is eight. The physical address, wmc.pa, is shown as 64 bits inthe example shown, although the invention is not limited to a specificwidth. The size of the contents, wmc.size, is also provided in a fieldwhich is shown as 10 bits in an exemplary embodiment. A “contents valid”flag, wmc.cv, of one bit is also included in the data structure,together with a two bit field for thread last used, or wmc.th. Inaddition, a six bit field for register last used, wmc.reg, is providedin an exemplary embodiment. Further, a one bit flag for register andthread valid, or wmc.rtv, may be provided.

[0049] The process by which the microcache is initially written with awide operand, and thereafter verified as valid for fast subsequentoperations, may be better appreciated from FIG. 8. The process begins at800, and progresses to step 805 where a check of the register contentsis made against the stored value wmc.rc. If true, a check is made atstep 810 to verify the thread. If true, the process then advances tostep 815 to verify whether the register and thread are valid. If step815 reports as true, a check is made at step 820 to verify whether thecontents are valid. If all of steps 805 through 820 return as true, thesubsequent instruction is able to utilize the existing wide operand asshown at step 825, after which the process ends. However, if any ofsteps 805 through 820 return as false, the process branches to step 830,where content, physical address and size are set. Because steps 805through 820 all lead to either step 825 or 830, steps 805 through 820may be performed in any order or simultaneously without altering theprocess. The process then advances to step 835 where size is checked.This check basically ensures that the size of the translation unit isgreater than or equal to the size of the wide operand, so that aphysical address can directly replace the use of a virtual address. Theconcern is that, in some embodiments, the wide operands may be largerthan the minimum region that the virtual memory system is capable ofmapping. As a result, it would be possible for a single contiguousvirtual address range to be mapped into multiple, disjoint physicaladdress ranges, complicating the task of comparing physical addresses.By determining the size of the wide operand and comparing that sizeagainst the size of the virtual address mapping region which isreferenced, the instruction is aborted with an exception trap if thewide operand is larger than the mapping region. This ensures secureoperation of the processor. Software can then re-map the region using alarger size map to continue execution if desired. Thus, if size isreported as unacceptable at step 835, an exception is generated at step840. If size is acceptable, the process advances to step 845 wherephysical address is checked. If the check reports as met, the processadvances to step 850, where a check of the contents valid flag is made.If either check at step 845 or 850 reports as false, the processbranches and new content is written into the dedicated storage 114, withthe fields thereof being set accordingly. Whether the check at step 850reported true, or whether new content was written at step 855, theprocess advances to step 860 where appropriate fields are set toindicate the validity of the data, after which the requested functioncan be performed at step 825. The process then ends.

[0050] Referring next to FIGS. 10 and 11, which together show theoperation of the microcache controller from a hardware standpoint, theoperation of the microcache controller may be better understood. In thehardware implementation, it is clear that conditions which are indicatedas sequential steps in FIG. 8 and 9 above can be performed in parallel,reducing the delay for such wide operand checking. Further, a copy ofthe indicated hardware may be included for each wide microcache, andthereby all such microcaches as may be alternatively referenced by aninstruction can be tested in parallel. It is believed that no furtherdiscussion of FIGS. 10 and 11 is required in view of the extensivediscussion of FIGS. 8 and 9, above.

[0051] Various alternatives to the foregoing approach do exist for theuse of wide operands, including an implementation in which a singleinstruction can accept two wide operands, partition the operands intosymbols, multiply corresponding symbols together, and add the productsto produce a single scalar value or a vector of partitioned values ofwidth of the register file, possibly after extraction of a portion ofthe sums. Such an instruction can be valuable for detection of motion orestimation of motion in video compression. A further enhancement of suchan instruction can incrementally update the dedicated storage if theaddress of one wide operand is within the range of previously specifiedwide operands in the dedicated storage, by loading only the portion notalready within the range and shifting the in-range portion as required.Such an enhancement allows the operation to be performed over a “slidingwindow” of possible values. In such an instruction, one wide operand isaligned and supplies the size and shape information, while the secondwide operand, updated incrementally, is not aligned.

[0052] Another alternative embodiment of the present invention candefine additional instructions where the result operand is a wideoperand. Such an enhancement removes the limit that a result can be nolarger than the size of a general register, further enhancingperformance. These wide results can be cached locally to the functionalunit that created them, but must be copied to the general memory systembefore the storage can be reused and before the virtual memory systemalters the mapping of the address of the wide result. Data paths must beadded so that load operations and other wide operations can read thesewide results—forwarding of a wide result from the output of a functionalunit back to its input is relatively easy, but additional data paths mayhave to be introduced if it is desired to forward wide results back toother functional units as wide operands.

[0053] As previously discussed, a specification of the size and shape ofthe memory operand is included in the low-order bits of the address. Ina presently preferred implementation, such memory operands are typicallya power of two in size and aligned to that size. Generally, one-half thetotal size is added (or inclusively or'ed, or exclusively or'ed) to thememory address, and one half of the data width is added (or inclusivelyor'ed, or exclusively or'ed) to the memory address. These bits can bedecoded and stripped from the memory address, so that the controller ismade to step through all the required addresses. This decreases thenumber of distinct operands required for these instructions, as thesize, shape and address of the memory operand are combined into a singleregister operand value.

[0054] Particular examples of wide operations which are defined by thepresent invention include the Wide Switch instruction that performsbit-level switching; the Wide Translate instruction which performs byte(or larger) table-lookup; Wide Multiply Matrix, Wide Multiply MatrixExtract and Wide Multiply Matrix Extract Immediate (discussed below),Wide Multiply Matrix Floating-point, and Wide Multiply Matrix Galois(also discussed below). While the discussion below focuses on particularsizes for the exemplary instructions, it will be appreciated that theinvention is not limited to a particular width.

[0055] The Wide Switch instruction rearranges the contents of up to tworegisters (256 bits) at the bit level, producing a full-width (128 bits)register result. To control the rearrangement, a wide operand specifiedby a single register, consisting of eight bits per bit position is used.For each result bit position, eight wide operand bits for each bitposition select which of the 256 possible source register bits to placein the result. When a wide operand size smaller than 128 bytes, the highorder bits of the memory operand are replaced with values correspondingto the result bit position, so that the memory operand specifies a bitselection within symbols of the operand size, performing the sameoperation on each symbol.

[0056] The Wide Translate instructions use a wide operand to specify atable of depth up to 256 entries and width of up to 128 bits. Thecontents of a register is partitioned into operands of one, two, four,or eight bytes, and the partitions are used to select values from thetable in parallel. The depth and width of the table can be selected byspecifying the size and shape of the wide operand as described above.

[0057] The Wide Multiply Matrix instructions use a wide operand tospecify a matrix of values of width up to 64 bits (one half of registerfile and data path width) and depth of up to 128 bits/symbol size. Thecontents of a general register (128 bits) is used as a source operand,partitioned into a vector of symbols, and multiplied with the matrix,producing a vector of width up to 128 bits of symbols of twice the sizeof the source operand symbols. The width and depth of the matrix can beselected by specifying the size and shape of the wide operand asdescribed above. Controls within the instruction allow specification ofsigned, mixed-signed, unsigned, complex, or polynomial operands.

[0058] The Wide Multiply Matrix Extract instructions use a wide operandto specify a matrix of value of width up to 128 bits (full width ofregister file and data path) and depth of up to 128 bits/symbol size.The contents of a general register (128 bits) is used as a sourceoperand, partitioned into a vector of symbols, and multiplied with thematrix, producing a vector of width up to 256 bits of symbols of twicethe size of the source operand symbols plus additional bits to representthe sums of products without overflow. The results are then extracted ina manner described below (Enhanced Multiply Bandwidth by ResultExtraction), as controlled by the contents of a general registerspecified by the instruction. The general register also specifies theformat of the operands: signed, mixed-signed, unsigned, and complex aswell as the size of the operands, byte (8 bit), doublet (16 bit),quadlet (32 bit), or hexlet (64 bit).

[0059] The Wide Multiply Matrix Extract Immediate instructions performthe same function as above, except that the extraction, operand formatand size is controlled by fields in the instruction. This form encodescommon forms of the above instruction without the need to initialize aregister with the required control information. Controls within theinstruction allow specification of signed, mixed-signed, unsigned, andcomplex operands.

[0060] The Wide Multiply Matrix Floating-point instructions perform amatrix multiply in the same form as above, except that the multipliesand additions are performed in floating-point arithmetic. Sizes ofhalf(16-bit), single (32-bit), double (64-bit), and complex sizes ofhalf, single and double can be specified within the instruction.

[0061] Wide Multiply Matrix Galois instructions perform a matrixmultiply in the same form as above, except that the multiples andadditions are performed in Galois field arithmetic. A size of 8 bits canbe specified within the instruction. The contents of a general registerspecify the polynomial with which to perform the Galois field remainderoperation. The nature of the matrix multiplication is novel anddescribed in detail below.

[0062] In another aspect of the invention, memory operands of eitherlittle-endian or big-endian conventional byte ordering are facilitated.Consequently, all Wide operand instructions are specified in two forms,one for little-endian byte ordering and one for big-endian byteordering, as specified by a portion of the instruction. The byte orderspecifies to the memory system the order in which to deliver the byteswithin units of the data path width (128 bits), as well as the order toplace multiple memory words (128 bits) within a larger Wide operand.Each of these instructions is described in greater detail in theAppendix filed herewith.

[0063] Another aspect of the present invention addresses extraction of ahigh order portion of a multiplier product or sum of products, as a wayof efficiently utilizing a large multiplier array. Related U.S. Pat No.5,742,840 and U.S. patent application Ser. No. 08/857596 (notice ofallowance Nov. 13,1998), describe a system and method for enhancing theutilization of a multiplier array by adding specific classes ofinstructions to a general-purpose processor. This addresses the problemof making the most use of a large multiplier array that is fully usedfor high-precision arithmetic—for example a 64×64 bit multiplier isfully used by a 64-bit by 64-bit multiply, but only one quarter used fora 32-bit by 32-bit multiply) for (relative to the multiplier data widthand registers) low-precision arithmetic operations. In particular,operations that perform a great many low-precision multiplies which arecombined (added) together in various ways are specified. One of theoverriding considerations in selecting the set of operations is alimitation on the size of the result operand. In an exemplaryembodiment, for example, this size might be limited to on the order of128 bits, or a single register, although no specific size limitationneed exist.

[0064] The size of a multiply result, a product, is generally the sum ofthe sizes of the operands, multiplicands and multiplier. Consequently,multiply instructions specify operations in which the size of the resultis twice the size of identically-sized input operands. For our prior artdesign, for example, a multiply instruction accepted two 64-bit registersources and produces a single 128-bit register-pair result, using anentire 64×64 multiplier array for 64-bit symbols, or half the multiplierarray for pairs of 32-bit symbols, or one-quarter the multiplier arrayfor quads of 16-bit symbols. For all of these cases, note that tworegister sources of 64 bits are combined, yielding a 128-bit result.

[0065] In several of the operations, including complex multiplies,convolve, and matrix multiplication, low-precision multiplier productsare added together. The additions further increase the requiredprecision. The sum of two products requires one additional bit ofprecision; adding four products requires two, adding eight productsrequires three, adding sixteen products requires four. In some priordesigns, some of this precision is lost, requiring scaling of themultiplier operands to avoid overflow, further reducing accuracy of theresult.

[0066] The use of register pairs creates an undesirable complexity, inthat both the register pair and individual register values must bebypassed to subsequent instructions. As a result, with prior arttechniques only half of the source operand 128-bit register values couldbe employed toward producing a single-register 128-bit result.

[0067] In the present invention, a high-order portion of the multiplierproduct or sum of products is extracted, adjusted by a dynamic shiftamount from a general register or an adjustment specified as part of theinstruction, and rounded by a control value from a register orinstruction portion as round-to-nearest/even, toward zero, floor, orceiling. Overflows are handled by limiting the result to the largest andsmallest values that can be accurately represented in the output result.This operation is more fully described in the attached Appendix.

[0068] In the present invention, when the extract is controlled by aregister, the size of the result can be specified, allowing rounding andlimiting to a smaller number of bits than can fit in the result. Thispermits the result to be scaled to be used in subsequent operationswithout concern of overflow or rounding, enhancing performance.

[0069] Also in the present invention, when the extract is controlled bya register, a single register value defines the size of the operands,the shift amount and size of the result, and the rounding control. Byplacing all this control information in a single register, the size ofthe instruction is reduced over the number of bits that such ainstruction would otherwise require, improving performance and enhancingflexibility of the processor.

[0070] The particular instructions included in this aspect of thepresent invention are Ensemble Convolve Extract, Ensemble MultiplyExtract, Ensemble Multiply Add Extract and Ensemble Scale Add Extract.each of which is more thoroughly treated in the appendix.

[0071] An aspect of the present invention defines the Ensemble Scale AddExtract instruction, that combines the extract control information in aregister along with two values that are used as scalar multipliers tothe contents of two vector multiplicands. This combination reduces thenumber of registers that would otherwise be required, or the number ofbits that the instruction would otherwise require, improvingperformance.

[0072] Several of these instructions (Ensemble Convolve Extract,Ensemble Multiply Add Extract) are typically available only in formswhere the extract is specified as part of the instruction. Analternative embodiment can incorporate forms of the operations in whichthe size of the operand, the shift amount and the rounding can becontrolled by the contents of a general register (as they are in theEnsemble Multiply Extract instruction). The definition of this kind ofinstruction for Ensemble Convolve Extract, and Ensemble Multiply AddExtract would require four source registers, which increases complexityby requiring additional general-register read ports.

[0073] Another alternative embodiment can reduce the number of registerread-ports required for implementation of instructions in which thesize, shift and rounding of operands is controlled by a register. Thevalue of the extract control register can be fetched using an additionalcycle on an initial execution and retained within or near the functionalunit for subsequent executions, thus reducing the amount of hardwarerequired for implementation with a small additional performance penalty.The value retained would be marked invalid, causing a re-fetch of theextract control register, by instructions that modify the register, oralternatively, the retained value can be updated by such an operation. Are-fetch of the extract control register would also be required if adifferent register number were specified on a subsequent execution. Itshould be clear that the properties of the above two alternativeembodiments can be combined.

[0074] Another aspect of the invention includes Galois field arithmetic,where multiplies are performed by an initial binary polynomialmultiplication (unsigned binary multiplication with carries suppressed),followed by a polynomial modulo/remainder operation (unsigned binarydivision with carries suppressed). The remainder operation is relativelyexpensive in area and delay. In Galois field arithmetic, additions areperformed by binary addition with carries suppressed, or equivalently, abitwise exclusive-or operation. In this aspect of the present invention,a matrix multiplication is performed using Galois field arithmetic,where the multiplies and additions are Galois field multiples andadditions.

[0075] Using prior art methods, a 16 byte vector multipled by a 16×16byte matrix can be performed as 256 8-bit Galois field multiplies and16*15=240 8-bit Galois field additions. Included in the 256 Galois fieldmultiplies are 256 polynomial multiplies and 256 polynomial remainderoperations. But by use of the present invention, the total computationcan be reduced significantly by performing 256 polynomial multiplies,240 16-bit polynomial additions, and 16 polynomial remainder operations.Note that the cost of the polynomial additions has been doubled, asthese are now 16-bit operations, but the cost of the polynomialremainder functions has been reduced by a factor of 16. Overall, this isa favorable tradeoff, as the cost of addition is much lower than thecost of remainder.

[0076] In a still further aspect of the present invention, a techniqueis provided for incorporating floating point information into processorinstructions. In related U.S. Pat. No. 5,812,439, a system and methodare described for incorporating control of rounding and exceptions forfloating-point instructions into the instruction itself. The presentinvention extends this invention to include separate instructions inwhich rounding is specified, but default handling of exceptions is alsospecified, for a particular class of floating-point instructions.Specifically, the SINK instruction (which converts floating-point valuesto integral values) is available with control in the instruction thatinclude all previously specified combinations (default-near rounding anddefault exceptions, Z—round-toward-zero and trap on exceptions, N—roundto nearest and trap on exceptions, F—floor rounding (toward minusinfinity) and trap on exceptions, C—ceiling rounding (toward plusinfinity) and trap on exceptions, and X—trap on inexact and otherexceptions), as well as three new combinations (Z.D—round toward zeroand default exception handling, F.D—floor rounding and default exceptionhandling, and C.D—ceiling rounding and default exception handling). (Theother combinations: N.D is equivalent to the default, and X.D—trap oninexact but default handling for other exceptions is possible but notparticularly valuable).

[0077] In yet another aspect of the present invention, best shown inFIG. 4, the present invention employs both decoupled access fromexecution pipelines and simultaneous multithreading in a unique way.Simultaneous Multithreaded pipelines have been employed in prior art toenhance the utilization of data path units by allowing instructions tobe issued from one of several execution threads to each functional unit.(e.g., Susan Eggers, University of Wash, papers on SimultaneousMultithreading).

[0078] Decoupled access from execution pipelines have been employed inprior art to enhance the utilization of execution data path units bybuffering results from an access unit, which computes addresses to amemory unit that in turn fetches the requested items from memory, andthen presenting them to an execution unit (e.g., James E. Smith, paperon Decoupled Access from Execution).

[0079] Compared to conventional pipelines, Eggers prior art used anadditional pipeline cycle before instructions could be issued tofunctional units, the additional cycle needed to determine which threadsshould be permitted to issue instructions. Consequently, relative toconventional pipelines, the prior art design had additional delay,including dependent branch delay.

[0080] The present invention contains individual access data path units,with associated register files, for each execution thread. These accessunits produce addresses, which are aggregated together to a commonmemory unit, which fetches all the addresses and places the memorycontents in one or more buffers. Instructions for execution units, whichare shared to varying degrees among the threads are also buffered forlater execution. The execution units then perform operations from allactive threads using functional data path units that are shared.

[0081] For instructions performed by the execution units, the extracycle required for prior art simultaneous multithreading designs isoverlapped with the memory data access time from prior art decoupledaccess from execution cycles, so that no additional delay is incurred bythe execution functional units for scheduling resources. Forinstructions performed by the access units, by employing individualaccess units for each thread the additional cycle for scheduling sharedresources is also eliminated.

[0082] This is a favorable tradeoff because, while threads do not sharethe access functional units, these units are relatively small comparedto the execution functional units, which are shared by threads.

[0083] With regard to the sharing of execution units, the presentinvention employs several different classes of functional units for theexecution unit, with varying cost, utilization, and performance. Inparticular, the G units, which perform simple addition and bitwiseoperations is relatively inexpensive (in area and power) compared to theother units, and its utilization is relatively high. Consequently, thedesign employs four such units, where each unit can be shared betweentwo threads. The X unit, which performs a broad class of data switchingfunctions is more expensive and less used, so two units are providedthat are each shared among two threads. The T unit, which performs theWide Translate instruction, is expensive and utilization is low, so thesingle unit is shared among all four threads. The E unit, which performsthe class of Ensemble instructions, is very expensive in area and powercompared to the other functional units, but utilization is relativelyhigh, so we provide two such units, each unit shared by two threads.

[0084] In FIG. 4, four copies of an access unit are shown, each with anaccess instruction fetch queue A-Queue 401-404, coupled to an accessregister file AR 405-408, each of which is, in turn, coupled to twoaccess functional units A 409-416. The access units functionindependently for four simultaneous threads of execution. These eightaccess functional units A 409-416 produce results for access registerfiles AR 405-408 and addresses to a shared memory system 417. The memorycontents fetched from memory system 417 are combined with executeinstructions not performed by the access unit and entered into the fourexecute instruction queues E-Queue 421-424. Instructions and memory datafrom E-queue 421-424 are presented to execution register files 425-428,which fetches execution register file source operands. The instructionsare coupled to the execution unit arbitration unit Arbitration 431, thatselects which instructions from the four threads are to be routed to theavailable execution units E 441 and 449, X 442 and 448, G 443-444 and446-447, and T 445. The execution register file source operands ER425-428 are coupled to the execution units 441-445 using source operandbuses 451-454 and to the execution units 445-449 using source operandbuses 455-458. The function unit result operands from execution units441-445 are coupled to the execution register file using result bus 461and the function units result operands from execution units 445-449 arecoupled to the execution register file using result bus 462.

[0085] The foregoing elements of the present invention may be betterunderstood with reference to the attached Appendix.

[0086] In a still further aspect of the present invention, an improvedinterprivilege gateway is described which involves increased parallelismand leads to enhanced performance. In related U.S. patent applicationSer. No. 08/541416, a system and method is described for implementing aninstruction that, in a controlled fashion, allows the transfer ofcontrol (branch) from a lower-privilege level to a higher-privilegelevel. The present invention is an improved system and method for amodified instruction that accomplishes the same purpose but withspecific advantages.

[0087] Many processor resources, such as control of the virtual memorysystem itself, input and output operations, and system control functionsare protected from accidental or malicious misuse by enclosing them in aprotective, privileged region. Entry to this region must be establishedonly though particular entry points, called gateways, to maintain theintegrity of these protected regions.

[0088] Prior art versions of this operation generally load an addressfrom a region of memory using a protected virtual memory attribute thatis only set for data regions that contain valid gateway entry points,then perform a branch to an address contained in the contents of memory.Basically, three steps were involved: load, branch, then check. Comparedto other instructions, such as register-to-register computationinstructions and memory loads and stores, and register-based branches,this is a substantially longer operation, which introduces delays andcomplexity to a pipelined implementation.

[0089] In the present invention, the branch-gateway instruction performstwo operations in parallel: 1) a branch is performed to the contents ofregister 0 and 2) a load is performed using the contents of register 1,using a specified byte order (little-endian) and a specified size (64bits). If the value loaded from memory does not equal the contents ofregister 0, the instruction is aborted due to an exception. In addition,3) a return address (the next sequential instruction address followingthe branch-gateway instruction) is written into register 0, provided theinstruction is not aborted. This approach essentially uses a firstinstruction to establish the requisite permission to allow user code toaccess privileged code, and then a second instruction is permitted tobranch directly to the privileged code because of the permissions issuedfor the first instruction.

[0090] In the present invention, the new privilege level is alsocontained in register 0, and the second parallel operation does not needto be performed if the new privilege level is not greater than the oldprivilege level. When this second operation is suppressed, the remainderof the instruction performs an identical function to a branch-linkinstruction, which is used for invoking procedures that do not requirean increase in privilege. The advantage that this feature brings is thatthe branch-gateway instruction can be used to call a procedure that mayor may not require an increase in privilege.

[0091] The memory load operation verifies with the virtual memory systemthat the region that is loaded has been tagged as containing validgateway data. A further advantage of the present invention is that thecalled procedure may rely on the fact that register 1 contains theaddress that the gateway data was loaded from, and can use the contentsof register 1 to locate additional data or addresses that the proceduremay require. Prior art versions of this instruction required that anadditional address be loaded from the gateway region of memory in orderto initialize that address in a protected manner—the present inventionallows the address itself to be loaded with a “normal” load operationthat does not require special protection.

[0092] The present invention allows a “normal” load operation to alsoload the contents of register 0 prior to issuing the branch-gatewayinstruction. The value may be loaded from the same memory address thatis loaded by the branch-gateway instruction, because the presentinvention contains a virtual memory system in which the region may beenabled for normal load operations as well as the special “gateway” loadoperation performed by the branch-gateway instruction.

[0093] In a further aspect of the present invention, a system and methodis provided for performing a three-input bitwise Boolean operation in asingle instruction. A novel method described in detail in appendix isused to encode the eight possible output states of such an operationinto only seven bits, and decoding these seven bits back into the eightstates.

[0094] In yet a further aspect to the present invention, a system andmethod is described for improving the branch prediction of simplerepetitive loops of code. The method includes providing a count fieldfor indicating how many times a branch is likely to be taken before itis not taken, which enhances the ability to properly predict both theinitial and final branches of simple loops when a compiler can determinethe number of iterations that the loop will be performed. This improvesperformance by avoiding misprediction of the branch at the end of aloop.

[0095] Having fully described a preferred embodiment of the inventionand various alternatives, those skilled in the art will recognize, giventhe teachings herein, that numerous alternatives and equivalents existwhich do not depart from the invention. It is therefore intended thatthe invention not be limited by the foregoing description, but only bythe appended claims.

We claim:
 1. In a system having a data path functional unit having afunctional unit data path width, a first memory system having a firstdata path width, and a second memory system having a data path widthwhich is greater than the functional unit data path width and greaterthan the first data path width, a method comprising: copying a firstmemory operand portion from the first memory system to the second memorysystem, the first memory operand portion having the first data pathwidth; and copying a second memory operand portion from the first memorysystem to the second memory system, the second memory operand portionhaving the first data path width and being catenated in the secondmemory system with the first memory operand portion, thereby formingcatenated data.
 2. The method of claim 1 further comprising reading atleast a portion of the catenated data which is greater in width than thefirst data path width.
 3. The method of claim 2 further comprisingspecifying a memory specifier from which a plurality of data path widthsof data can be read.
 4. The method of claim 3 wherein the memoryspecifier comprises: a memory address; a memory size; and a memoryshape.
 5. The method of claim 2 further comprising checking the validityof the first memory operand portion and, if valid, permitting asubsequent instruction to access the first memory operand portion. 6.The method of claim 2 further comprising checking the validity of thesecond memory operand portion and, if valid, permitting a subsequentinstruction to access the second memory operand portion.
 7. In a systemhaving a data path functional unit having a functional unit data pathwidth, a first memory system having a first data path width, and asecond memory system having a data path width which is greater than thefunctional unit data path width and greater than the first data pathwidth, a method comprising: copying a first memory operand portion fromthe first memory system to the second memory system, the first memoryoperand portion having the first data path width; copying a secondmemory operand portion from the first memory system to the second memorysystem, the second memory operand portion having the first data pathwidth; and catenating the second memory operand portion in the secondmemory system with the first memory operand portion, thereby formingcatenated data.
 8. The method of claim 7 further comprising reading atleast a portion of the catenated data which is greater in width than thefirst data path width.
 9. The method of claim 8 further comprisingspecifying a memory specifier from which a plurality of data path widthsof data can be read.
 10. The method of claim 9 wherein the memoryspecifier comprises: a memory address; a memory size; and a memoryshape.
 11. The method of claim 8 further comprising checking thevalidity of the first memory operand portion and, if valid, permitting asubsequent instruction to access the first memory operand portion. 12.The method of claim 8 further comprising checking the validity of thesecond memory operand portion and, if valid, permitting a subsequentinstruction to access the second memory operand portion.
 13. In a systemhaving a data path functional unit having a functional unit data pathwidth, a first memory system having a first data path width, and asecond memory system having a data path width which is greater than thefunctional unit data path width and greater than the first data pathwidth, a system comprising: a first copying module configured to copy afirst memory operand portion from the first memory system to the secondmemory system, the first memory operand portion having the first datapath width; and a second copying module configured to copy a secondmemory operand portion from the first memory system to the second memorysystem, the second memory operand portion having the first data pathwidth and being catenated in the second memory system with the firstmemory operand portion, thereby forming catenated data.
 14. The systemof claim 13 further comprising a reading module configured to read atleast a portion of the catenated data which is greater in width than thefirst data path width.
 15. In a system having a data path functionalunit having a functional unit data path width, a first memory systemhaving a first data path width, and a second memory system having a datapath width which is greater than the functional unit data path width andgreater than the first data path width, a system comprising: a firstcopying module configured to copy a first memory operand portion fromthe first memory system to the second memory system, the first memoryoperand portion having the first data path width; and a second copyingmodule configured to copy a second memory operand portion from the firstmemory system to the second memory system, the second memory operandportion having the first data path width.
 16. The system of claim 15further comprising a catenating module configured to catenate in thesecond memory system the second memory operand portion with the firstmemory operand portion, thereby forming catenated data.
 17. The systemof claim 16 further comprising a reading module configured to read atleast a portion of the catenated data which is greater in width than thefirst data path width.